package com.qf.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * 跨域测试
 * @author lixu
 */
@RestController
@RequestMapping("/cors")
@CrossOrigin//跨域注解  所有跨域请求都允许
//@CrossOrigin(origins = {"http://localhost:8080","http://www.baidu.com"})//跨域注解
public class AjaxController {

    /**
     * 跨域测试  请求  响应 全过程？
     */
    @RequestMapping("/test1")
    public String test1(HttpServletResponse response){
       /// response.addHeader("");

        return "OK";
    }
}
